<div class="main-content">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <ol class="breadcrumb">
                    <li>
                        <i class="clip-file"></i>
                        <a href="#">
                            Logística
                        </a>
                    </li>
                    <li class="active">
                        Stock Producto
                    </li>					
                </ol>
                <div class="page-header">
                    <h1>Stock Producto <small>Formulario</small></h1>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <!-- start: DYNAMIC TABLE PANEL -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Productos
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <!--<a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a> -->
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <!-- start: TEXT FIELDS PANEL -->
                            <div class="panel-body">
                                <form role="form" method="post" class="form-horizontal" >   
                                    <div class="row">
                                        <div class="col-md-3"> 
                                            <input type="hidden" id="prodId" value="<?= $prod; ?>">
                                            <?php
                                            if (!empty($colors)) :
                                                foreach ($colors as $fila):
                                                    ?>  
                                                    <div class="row">
                                                        <div class="col-md-12"> 
                                                            <div class="form-group">
                                                                <label class="col-sm-3 control-label" for="">
                                                                    <?= $fila->desc_color; ?>
                                                                </label>
                                                                <div class="col-sm-9" style="cursor: pointer" onclick="stockProdxColor('<?= base_url("logistica/proceso/stockProductoxColor") ?>',<?= $prod; ?>,<?= $fila->color_id; ?>, '<?= $fila->desc_color; ?>', 'stockAlm');" >
                                                                    <!--<input type="hidden" id="" value="<?= $fila->color_id; ?>"> -->
                                                                    <div style="border-radius: 4px; box-shadow: 2px 2px 10px #bdbdbd; border:1px solid #a5a5a5; padding: 15px; background-color: <?= $fila->cod_rgb; ?>"></div>
                                                                </div>   
                                                            </div>
                                                        </div>                                                
                                                    </div>
                                                    <hr>
                                                    <?php
                                                endforeach;
                                            endif;
                                            ?>  
                                        </div>
                                        <div class="col-md-6">
                                            <input type='hidden' id='totalAlm' >
                                            <div class="row" id="stockAlm"></div>
                                            <div class="row">
                                                <div class="col-md-6"></div>
                                                <div class="col-md-4">
                                                    <button class="btn btn-primary btn-block" id="actualizarStock" type="button">
                                                        <i class="icon-save"></i>
                                                        Guardar                                        
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>                                    
                            </div>
                            <!-- end: TEXT FIELDS PANEL -->
                        </div>
                    </div>
                </div>
                <!-- end: DYNAMIC TABLE PANEL -->
            </div>
        </div>
    </div>    
</div>

<script>
    $(function(){
       $("#actualizarStock").on('click',function(){
         actualizarStockProd('<?=  base_url("logistica/proceso/actualizarStock")?>');  
       });
    });
</script>

